{% extends "base.html" %}


{% block menu %}

 <div class="navbar navbar-inverse navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
          <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="brand" href="#">Project Manager System</a>
          <div class="nav-collapse collapse">
            <ul class="nav">
              <li><a href="/admfase/{{session['proyectoid']}}">Administrar Fase</a></li>
              <li class="active"><a href="">Administrar Rol</a></li>
              <li><a href="/">Logout</a></li>
              <li><a href="#contact">Usuario: {{session['username']}}</a></li>
              </ul>
          </div>
         </div>
        </div>
</div>
              
{%endblock%}

{%block mensaje%}
        {% with messages = get_flashed_messages(with_categories=true) %}
          {% if messages %}
          <div class="container" align="center">
            {% for category, message in messages %}
              <h4 class="{{ category }}">{{ message }}</h4>
            {% endfor %}
		  </div>
          {% endif %}
        {% endwith %}
{%endblock%}

{%block content%}
<div class="fases">
		<div class="container" align="center">
        <h3 class="muted">{{session['proyectonombre']}} - {{session['fasenombre']}}</h3>
        </div>
        <div class="row" >
                <div class="span12">
                        <h2> Listado de Roles </h2>
                        <table class="table table-striped table-bordered">
                                <tr>
                                        <th>Nombre</th>
                                        <th>Permiso Tipo</th>
				                        <th>Permiso Item</th>
				                        <th>Permiso LB</th>
				                        <th>Editar</th>
				                        <th>Eliminar</th>
				                        <th>Consultar</th>
				                        <th>Asignar</th>
				                        <th>Desasignar</th>
                                </tr>
                                {% for r in roles %}
                    
                                <tr>
                                        <td>{{r.nombre}}</td>
                                        <td>{{permisoTipo(r)}}</td>
                                        <td>{{permisoItem(r)}}</td>
                                        <td>{{permisoLB(r)}}</td>
                                        <td>
                                        <a class="btn" href="/admrol/editarrol/{{r.id}}">Editar</a>
                                        </td>
		                                <td>
		                                <a class="btn btn-danger" href="/admrol/eliminarrol/{{r.id}}">Eliminar</a>
                                        </td>
                                        <td>
                                        <a class="btn btn-info" href="/admrol/consultarrol/{{r.id}}">Consultar</a>
                                        </td>
                                        <td>
                                        <a class="btn btn-warning" href="/admrol/asignar/{{r.id}}">Asignar</a>
                                        </td>
                                         <td>
                                        <a class="btn btn-inverse" href="/admrol/desasignar/{{r.id}}">Desasignar</a>
                                        </td>
                        </tr>
                                {% else %}
                        
                                <tr>
                                        No se han creado roles aún
                                </tr>
                                {% endfor %}
                </table>
                <a class="btn" href="/admfase/{{session['proyectoid']}}"><i class="icon-arrow-left"></i> Atras</a>
        </div>
	      <div class="span3 bs-docs-sidebar">
        	<ul class="nav nav-list bs-docs-sidenav">
				  <li><a href="/admrol/crearrol/"><i class="icon-chevron-right"></i> Crear Rol</a></li>
				</ul>
				<br/>
				</div>
			<div class="span3" align="right">
			<table class="table table-bordered">
				<caption><strong class="text-info">Legenda</strong></caption>
				<tr>
				<td> Cr</td>
				<td>Crear</td>
				</tr>
				<tr>
				<td>Ed </td>
				<td> Editar</td>
				</tr>
				<tr>
				<td>El</td> 
				<td>Eliminar</td>
				</tr>
				<tr>
				<td>Ap</td>
				<td>Aprobar</td>
				</tr>
				<tr>
				<td>Rir </td>
				<td> Revivir</td>
				</tr>
				<tr>
				<td>Rar </td>
				<td> Reversionar</td>
				</tr>
				<tr>
				<td>Asp </td>
				<td>Asignar Padre</td>
				</tr>
				<tr>
				<td>Asa </td>
				<td> Asignar Antecesor</td>
				</tr>
			</table>	
				
		</div>
</div>
{%endblock%}
